using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class UDF_FormOptionsMap : EntityTypeConfiguration<UDF_FormOptions>
    {
        public UDF_FormOptionsMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.RecordType)
                .HasMaxLength(100);

            this.Property(t => t.Caption)
                .HasMaxLength(50);

            this.Property(t => t.CustomReport)
                .HasMaxLength(100);

            this.Property(t => t.Background_Image)
                .HasMaxLength(100);

            this.Property(t => t.Print_Orientation)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.Table)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("UDF_FormOptions");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.RecordType).HasColumnName("RecordType");
            this.Property(t => t.Height).HasColumnName("Height");
            this.Property(t => t.Width).HasColumnName("Width");
            this.Property(t => t.Columns).HasColumnName("Columns");
            this.Property(t => t.maximized).HasColumnName("maximized");
            this.Property(t => t.Caption).HasColumnName("Caption");
            this.Property(t => t.RowHeight).HasColumnName("RowHeight");
            this.Property(t => t.SeperatePages).HasColumnName("SeperatePages");
            this.Property(t => t.GrayGroup).HasColumnName("GrayGroup");
            this.Property(t => t.HideGroup).HasColumnName("HideGroup");
            this.Property(t => t.SuppressEmptyFields).HasColumnName("SuppressEmptyFields");
            this.Property(t => t.Arabic).HasColumnName("Arabic");
            this.Property(t => t.CustomReport).HasColumnName("CustomReport");
            this.Property(t => t.Background_Color).HasColumnName("Background_Color");
            this.Property(t => t.Background_Image).HasColumnName("Background_Image");
            this.Property(t => t.Imaging_Enabled).HasColumnName("Imaging_Enabled");
            this.Property(t => t.DocMan_Enabled).HasColumnName("DocMan_Enabled");
            this.Property(t => t.ContactMan_Enabled).HasColumnName("ContactMan_Enabled");
            this.Property(t => t.Print_Orientation).HasColumnName("Print_Orientation");
            this.Property(t => t.Workflow_Enabled).HasColumnName("Workflow_Enabled");
            this.Property(t => t.UID).HasColumnName("UID");
            this.Property(t => t.Private).HasColumnName("Private");
            this.Property(t => t.Table).HasColumnName("Table");
            this.Property(t => t.DataStructure).HasColumnName("DataStructure");
        }
    }
}
